// Copyright (c) 2009 Mike Haight, Andy Kipp
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.

#pragma once

#include "Object.h"

namespace HandBanana { namespace Core
{
    /// <summary>
    /// Represents two values which describe the x and y location of a rectangle.
    /// </summary>
    struct Location : public Object
    {
    // Constructors
    public:
        /// <summary>
        /// Create a new instance of the Location class
        /// </summary>
        Location(void);

        /// <summary>
        /// Create a new instance of the Location class
        /// </summary>
        Location(float argX, float argY);


    // Public Methods
    public:
        /// <summary>
        /// Returns true if the provided Location is equal to this Location.
        /// </summary>
        bool Equals(const Location& argObject) const;

        /// <summary>
        /// Returns true if the object is empty.  The object is empty if its X and Y are equal to 0.
        /// </summary>
        bool IsEmpty(void) const;


    // Object Overrides
    public:
        /// <summary>
        /// Overrides the Object::ToString() method.
        /// </summary>
        virtual std::wstring ToString(void) const override;


    // Public Data Members
    public:
        float X, Y;


    // Public Static Methods
    public:
        /// <summary>
        /// Creates a new instance of Size from the provided string.
        /// The string is in the form of "[ws][float][ws],[ws][float][ws]"
        /// </summary>
        static Location Parse(const std::wstring& argText);

    };
} }